
import { useMessage } from "/@/hooks/web/useMessage";
export const useSuccess = () => {
	const { createMessage: msg } = useMessage();
	function rhandleSuccess(res, cb, options = { success: '操作成功', error: '操作失败' }) {
		if (res.isSucceed) {
			msg.success(res.msg || options.success);
		} else {
			msg.error(res.msg || options.error);
		}
		cb()
	}

	return { rhandleSuccess }
}